/* 
 * File:   BlendingMethod.h
 * Author: RedEyedKiller
 *
 * Created on 7 Οκτώβριος 2011, 1:13 πμ
 */

#ifndef BLENDINGMETHOD_H
#define	BLENDINGMETHOD_H

#include <SDL/SDL_opengl.h>
#include <string>

namespace gl
{

enum BlendingMethodName
{
    BLEND_UNKNOWN = -1,
    BLEND_ALPHA,
    BLEND_ADD,
    BLEND_LIGHT,
    BLEND_DARK,
    BLEND_FILTER,
    BLEND_NONE,
    BLEND_ALL
};

BlendingMethodName GetBlendingMethodName(const std::string& name);

/**
 * This class represents a opengl blending method.
 */
class BlendingMethod
{
public:

    BlendingMethod(){}
    
    virtual ~BlendingMethod()
    {
    }
    
    void Set(GLenum sfactor, GLenum dfactor);

    /**
     * Set the parameters of this blending method as the parameters of 
     * glBlendFunc.
     */
    void Enable() const;
    
private:
    GLenum sfactor;
    GLenum dfactor;
};

};
#endif	/* BLENDINGMETHOD_H */

